var express = require('express');

var app = express();

app.get('/', function(req, resp){
    resp.send('root');
});

app.get('/about', function(req, resp){
    resp.send('about');
});

app.get('random.text', function(req, resp){
    resp.send('random.text');
});

app.get('/ab?cd',function(req, resp){
    resp.send('ab?cd');
});

app.get('/a(bc)?d',function(req, resp){
    resp.send('a(bc)?d');
});

app.get('/ab+cd', function(req, resp){
    resp.send('ab+cd');
});

app.get('/ab*cd', function(req, resp){
    resp.send('ab*cd');
});

app.get(/ab/, function(req, resp){
    resp.send('/ab/');
});

app.get(/.*error$/, function(req, resp){
    resp.send('/.*error$/');
});

// ---------------------------------------

app.get('/user/:userId', function(req, resp){
    console.log("/user/:userId" + JSON.stringify(req.params));
    resp.send(JSON.stringify(req.params));
});


app.listen(3000, function(){
    console.log("Server is running.")
});